function [p_int,res] = Func_Loc_Res_Coef(x)
%%% int indicates, at this boundary point, the interger number of cells to the central
%%% res indicates, at this boundary point, the ratio it takes up dx
%%% when the curve boundary is right at the rec boundary, int=nr-1, res=1
    x = abs(x);
    int = floor(x);
    res = x-int;
    res(res<1e-6) = 0;
    p_int = int + 1;
    p_int = p_int - (res == 0);
    res = res + (res == 0);
    p_int(x==0) = 0;
    res(x==0) = 0;
end